import request from '../utils/request'

export function getEmpListApi (params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}

export function addEmpListApi (data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

export function uploadExcelApi (data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

export function getEmployeesApi (id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}

export function saveUserInfoApi (data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

export function getPersonalDetailApi (data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}

export function getJobInfoApi (id) {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'get'
  })
}
